import get from '@dfeidao/atom-web/local/get';
import set from '@dfeidao/atom-web/local/set';
import fire from '@dfeidao/atom-web/msg/fire';
import error from '@dfeidao/atom-web/msgbox/error';
import { IFeidaoAiBrowserComponent } from '@dfeidao/web/interfaces';

interface Aa {
	id: string;
	p_id: string;
	flag: number;
	client_point_id: string;
	client_style: string;
}

export default async function a003(fd: IFeidaoAiBrowserComponent) {
	// 修改
	const client_point_id: string = get(fd, 'client_point_id');
	const client_style: string = get(fd, 'client_style');
	const curr_dept = get(fd, 'curr_dept') as Aa;
	if (!curr_dept) {
		error('请先选中一条数据');
		return;
	}
	curr_dept.flag = 3;// 修改
	curr_dept.client_point_id = client_point_id;
	curr_dept.client_style = client_style;
	set(fd, 'curr_dept', curr_dept);

	fire('zj-000003', 'ec001', curr_dept);
}
